__author__ = 'Dianlei Zhang'

import urllib
import urllib.request

data = {}
data['word'] = "yifan"

urlValue = urllib.parse.urlencode(data)
url = "http://www.baidu.com/s?"

fullURL = url + urlValue

data = urllib.request.urlopen(fullURL).read()
data = data.decode("UTF-8")

print(data)

# data是一个字典, 然后通过urllib.parse.urlencode()来将data转换为 ‘word=Jecvay+Notes’的字符串, 最后和url合并为full_url,

